import 'package:flutter/material.dart';
import 'GradientButtonRoute.dart';
import 'CustomPaintRoute.dart';

class CustomWidgetsPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return new _CustomWidgetsPageState();
  }
}

class _CustomWidgetsPageState extends State<CustomWidgetsPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Wrap(
          spacing: 8.0,
          runSpacing: 4.0,
          alignment: WrapAlignment.center,
          children: <Widget>[
            RaisedButton(
              color: Colors.blue,
              highlightColor: Colors.blue[700],
              colorBrightness: Brightness.dark,
              splashColor: Colors.grey,
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(20.0),
              ),
              child: Text('组合现有Widget实现（例：GradientButton）'),
              onPressed: () {
                Navigator.push(
                  context,
                  new MaterialPageRoute(
                    builder: (context) {
                      return GradientButtonRoute();
                    },
                  ),
                );
              },
            ),
            RaisedButton(
              color: Colors.blue,
              highlightColor: Colors.blue[700],
              colorBrightness: Brightness.dark,
              splashColor: Colors.grey,
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(20.0),
              ),
              child: Text('绘制UI实现'),
              onPressed: () {
                Navigator.push(
                  context,
                  new MaterialPageRoute(
                    builder: (context) {
                      return CustomPaintRoute();
                    },
                  ),
                );
              },
            ),
          ],
        ),
      ),
    );
  }
}
